# RUN: not tfg-translate -graphdef-to-mlir %s 2>&1 | FileCheck %s

# CHECK: Non-existent input case/cond/cond/Switch_3 in node case/cond/cond/Merge

node {
  name: "ConstantFolding/case/cond/cond/Merge_const"
  op: "Const"
  input: "^case/cond/cond/Merge"
  device: "/job:localhost/replica:0/task:0/device:CPU:0"
  attr {
    key: "dtype"
    value {
      type: DT_DOUBLE
    }
  }
  attr {
    key: "value"
    value {
      tensor {
        dtype: DT_DOUBLE
        tensor_shape {
        }
        tensor_content: "\342\351\225\262\014q\274?"
      }
    }
  }
}
node {
  name: "ConstantFolding/case/cond/cond/Switch_3-folded-1"
  op: "Const"
  device: "/job:localhost/replica:0/task:0/device:CPU:0"
  attr {
    key: "dtype"
    value {
      type: DT_DOUBLE
    }
  }
  attr {
    key: "value"
    value {
      tensor {
        dtype: DT_DOUBLE
        tensor_shape {
        }
        tensor_content: "\342\351\225\262\014q\274?"
      }
    }
  }
}
node {
  name: "Const_3"
  op: "Const"
  device: "/job:localhost/replica:0/task:0/device:CPU:0"
  attr {
    key: "dtype"
    value {
      type: DT_DOUBLE
    }
  }
  attr {
    key: "value"
    value {
      tensor {
        dtype: DT_DOUBLE
        tensor_shape {
        }
        double_val: 0.1234
      }
    }
  }
}
node {
  name: "case/cond/cond/Merge"
  op: "Merge"
  input: "case/cond/cond/Switch_3"
  input: "ConstantFolding/case/cond/cond/Switch_3-folded-1"
  device: "/job:localhost/replica:0/task:0/device:CPU:0"
  attr {
    key: "N"
    value {
      i: 2
    }
  }
  attr {
    key: "T"
    value {
      type: DT_DOUBLE
    }
  }
}
node {
  name: "Less"
  op: "Const"
  device: "/job:localhost/replica:0/task:0/device:CPU:0"
  attr {
    key: "dtype"
    value {
      type: DT_BOOL
    }
  }
  attr {
    key: "value"
    value {
      tensor {
        dtype: DT_BOOL
        tensor_shape {
        }
        tensor_content: "\000"
      }
    }
  }
}
node {
  name: "case/cond/Switch_1"
  op: "Switch"
  input: "Const_3"
  input: "Less"
  device: "/job:localhost/replica:0/task:0/device:CPU:0"
  attr {
    key: "T"
    value {
      type: DT_DOUBLE
    }
  }
  attr {
    key: "_class"
    value {
      list {
        s: "loc:@Const_3"
      }
    }
  }
}
node {
  name: "case/cond/Merge"
  op: "Merge"
  input: "ConstantFolding/case/cond/cond/Merge_const"
  input: "case/cond/Switch_1:1"
  device: "/job:localhost/replica:0/task:0/device:CPU:0"
  attr {
    key: "N"
    value {
      i: 2
    }
  }
  attr {
    key: "T"
    value {
      type: DT_DOUBLE
    }
  }
}
